<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>tl-ops-manage后台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script src="../lib/layui/layui.js" v="layui" e="layui"></script>
    <link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />
</head>
<style>
    .layui-form-pane .layui-form-label {
        width: 160px;
    }
    .layui-form-pane .layui-input-block {
        margin-left: 160px;
    }
    input {
        color: darkorchid;
        font-weight: 700;
    }
    .tl-ops-web-limit-token-form-span{
        margin-left: -15px;
        position: relative;
        top: 3px;
    }
    .tl-icon-font{
        border-radius: 23px;
        padding: 2px;
        font-size: 12px;
        background: burlywood;
        cursor: pointer;
    }
</style>
<body>

    <div class="layui-form layui-form-pane" lay-filter="tl-ops-web-limit-token-form" id="tl-ops-web-limit-token-form" style="padding: 20px 20px 0px 20px;">
        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label">服务名称</label>
            <div class="layui-input-block">
                <input type="text" name="service_name" class="layui-input" placeholder="请输入服务名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">令牌单位</label>
            <div class="layui-input-block">
                <input type="number" name="block" class="layui-input"  placeholder="请输入令牌单位"
                    id="tl-tips-block" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-block','单次取用令牌数量单位，如 1024，以字节为单位，可做字节整型流控')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">令牌桶最大容量</label>
            <div class="layui-input-block">
                <input type="number" name="capacity" class="layui-input" value="service" placeholder="请输入令牌桶最大容量"
                    id="tl-tips-capacity" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-capacity','令牌桶最大容量，如 1024000，以字节为单位，可做字节整型流控')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">令牌桶生成速率(s)</label>
            <div class="layui-input-block">
                <input type="number" name="rate" class="layui-input" placeholder="请输入每秒令牌生成数量"
                    id="tl-tips-rate" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-rate','每秒令牌生成数量，如 10240 ')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">启动预热令牌数</label>
            <div class="layui-input-block">
                <input type="number" name="warm" class="layui-input" placeholder="请输入预热令牌数"
                    id="tl-tips-warm" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-warm','服务启动时，会对令牌桶初始化，并根据设置值进行预生成令牌数')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">令牌桶扩容比例</label>
            <div class="layui-input-block">
                <input type="number" name="expand" class="layui-input"  placeholder="请输入令牌桶扩容比例"
                    id="tl-tips-expand" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-expand','服务升级时的自动化扩容令牌桶的比例，如0.5')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">令牌桶缩容比例</label>
            <div class="layui-input-block">
                <input type="number" name="shrink" class="layui-input"  placeholder="请输入令牌桶缩容比例"
                    id="tl-tips-shrink" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-shrink','服务降级时的自动化缩容令牌桶的比例，如0.5')">
            </div>
        </div>
        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="tl-ops-web-limit-form-submit" id="tl-ops-web-limit-form-submit" value="确认">
        </div>
    </div>

    <script src="../tl_ops_web_comm.js"></script>
    <script>
        layui.use(['table', 'form'], function () {
            window.form = layui.form;
            window.layedit = layui.layedit;
            window.tl_ops_web_limit_form_render = function(data){
                form.val("tl-ops-web-limit-token-form", Object.assign(form.val("tl-ops-web-limit-token-form"), data))
                form.render()
            }
        })
    </script>
</body>

</html>